package com.ruoyi.web.controller.retirement;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.retirement.domain.RetirementArticleEnroll;
import com.ruoyi.retirement.service.IRetirementArticleEnrollService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 文章收藏列表Controller
 * 
 * @author 曹旭
 * @date 2025-09-03
 */
@RestController
@RequestMapping("/retirement/retirementEnroll")
public class RetirementArticleEnrollController extends BaseController
{
    @Autowired
    private IRetirementArticleEnrollService retirementArticleEnrollService;

    /**
     * 查询文章收藏列表列表
     */
    @GetMapping("/list")
    public TableDataInfo list(RetirementArticleEnroll retirementArticleEnroll)
    {
        startPage();
        List<RetirementArticleEnroll> list = retirementArticleEnrollService.selectRetirementArticleEnrollList(retirementArticleEnroll);
        return getDataTable(list);
    }


    /**
     * 新增文章收藏列表
     */
    @Log(title = "文章收藏列表", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody RetirementArticleEnroll retirementArticleEnroll)
    {
        return toAjax(retirementArticleEnrollService.insertRetirementArticleEnroll(retirementArticleEnroll));
    }

}
